package com.zy.openchat.core.model.message;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

public class SecretChatState implements Parcelable {

    private final String CLOSED = "secretChatStateClosed";
    private final String PENDING = "secretChatStatePending";
    private final String READY = "secretChatStateReady";
    @SerializedName("@type")
    public String type;

    public boolean isClosed(){
        return CLOSED.equals(type);
    }

    public boolean isReady(){
        return READY.equals(type);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.type);
    }

    public void readFromParcel(Parcel source) {
        this.type = source.readString();
    }

    public SecretChatState() {
    }

    protected SecretChatState(Parcel in) {
        this.type = in.readString();
    }

    public static final Creator<SecretChatState> CREATOR = new Creator<SecretChatState>() {
        @Override
        public SecretChatState createFromParcel(Parcel source) {
            return new SecretChatState(source);
        }

        @Override
        public SecretChatState[] newArray(int size) {
            return new SecretChatState[size];
        }
    };
}
